package com.mdd.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum UserRoleEnum {


    CUSTOMER(0, "客户"),
    LAWYER(1, "律师"),
    AUDITOR(2, "审核员"),
    ADMIN(3, "超管"),
    SELLER(4, "销售");

    private final Integer val;

    private final String desc;

    /**
     * 根据编码获取Msg
     *
     * @author fzr
     * @param code 类型
     * @return String
     */
    public static String getMsgByCode(Integer code){
        for(UserRoleEnum enumItem: UserRoleEnum.values()) {
            if (enumItem.getVal() == code) {
                return enumItem.getDesc();
            }
        }
        return null;
    }
}
